/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * JockerReplaceForm.java
 *
 * Created on Dec 4, 2011, 5:40:01 PM
 */
package makao;

import shared.Card;

/**
 *
 * @author gekon
 */
public class JokerReplaceForm extends javax.swing.JFrame
{

    private MakaoView makaoView = null;
    private int suit;
    private int type;
    /** Creates new form JockerReplaceForm */
    public JokerReplaceForm(MakaoView makaoView)
    {
        this.makaoView = makaoView;
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroup1 = new javax.swing.ButtonGroup();
        buttonGroup2 = new javax.swing.ButtonGroup();
        jPanel1 = new javax.swing.JPanel();
        jRadioButton5 = new javax.swing.JRadioButton();
        jLabel5 = new javax.swing.JLabel();
        jRadioButton6 = new javax.swing.JRadioButton();
        jLabel1 = new javax.swing.JLabel();
        jRadioButton7 = new javax.swing.JRadioButton();
        jLabel2 = new javax.swing.JLabel();
        jRadioButton8 = new javax.swing.JRadioButton();
        jLabel3 = new javax.swing.JLabel();
        jButtonConfirm = new javax.swing.JButton();
        jRadioButton2 = new javax.swing.JRadioButton();
        jRadioButton3 = new javax.swing.JRadioButton();
        jRadioButton4 = new javax.swing.JRadioButton();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        jRadioButton9 = new javax.swing.JRadioButton();
        jLabel4 = new javax.swing.JLabel();
        jRadioButton10 = new javax.swing.JRadioButton();
        jLabel6 = new javax.swing.JLabel();
        jRadioButtonK = new javax.swing.JRadioButton();
        jRadioButtonA = new javax.swing.JRadioButton();
        jRadioButtonJ = new javax.swing.JRadioButton();
        jRadioButtonQ = new javax.swing.JRadioButton();
        jLabel7 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        jLabel16 = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jRadioButtonClub = new javax.swing.JRadioButton();
        jRadioButtonHeart = new javax.swing.JRadioButton();
        jLabel8 = new javax.swing.JLabel();
        jRadioButtonDiamond = new javax.swing.JRadioButton();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jRadioButtonSpade = new javax.swing.JRadioButton();
        jLabel18 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(makao.MakaoApp.class).getContext().getResourceMap(JokerReplaceForm.class);
        setTitle(resourceMap.getString("Form.title")); // NOI18N
        setAlwaysOnTop(true);
        setName("Form"); // NOI18N
        setResizable(false);
        getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jPanel1.setBackground(resourceMap.getColor("jPanel1.background")); // NOI18N
        jPanel1.setBorder(javax.swing.BorderFactory.createLineBorder(resourceMap.getColor("jPanel1.border.lineColor"), 7)); // NOI18N
        jPanel1.setName("jPanel1"); // NOI18N
        jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jRadioButton5.setBackground(resourceMap.getColor("jRadioButton5.background")); // NOI18N
        buttonGroup2.add(jRadioButton5);
        jRadioButton5.setName("jRadioButton5"); // NOI18N
        jPanel1.add(jRadioButton5, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 120, -1, 30));

        jLabel5.setIcon(resourceMap.getIcon("jLabel5.icon")); // NOI18N
        jLabel5.setName("jLabel5"); // NOI18N
        jPanel1.add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 120, 30, 30));

        jRadioButton6.setBackground(resourceMap.getColor("jRadioButton6.background")); // NOI18N
        buttonGroup2.add(jRadioButton6);
        jRadioButton6.setName("jRadioButton6"); // NOI18N
        jPanel1.add(jRadioButton6, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 160, -1, 30));

        jLabel1.setIcon(resourceMap.getIcon("jLabel1.icon")); // NOI18N
        jLabel1.setName("jLabel1"); // NOI18N
        jPanel1.add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 160, -1, 30));

        jRadioButton7.setBackground(resourceMap.getColor("jRadioButton7.background")); // NOI18N
        buttonGroup2.add(jRadioButton7);
        jRadioButton7.setName("jRadioButton7"); // NOI18N
        jPanel1.add(jRadioButton7, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 200, -1, 30));

        jLabel2.setIcon(resourceMap.getIcon("jLabel2.icon")); // NOI18N
        jLabel2.setName("jLabel2"); // NOI18N
        jPanel1.add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 200, -1, 30));

        jRadioButton8.setBackground(resourceMap.getColor("jRadioButton8.background")); // NOI18N
        buttonGroup2.add(jRadioButton8);
        jRadioButton8.setName("jRadioButton8"); // NOI18N
        jPanel1.add(jRadioButton8, new org.netbeans.lib.awtextra.AbsoluteConstraints(260, 120, -1, 30));

        jLabel3.setIcon(resourceMap.getIcon("jLabel3.icon")); // NOI18N
        jLabel3.setName("jLabel3"); // NOI18N
        jPanel1.add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(290, 120, -1, 30));

        jButtonConfirm.setText(resourceMap.getString("jButtonConfirm.text")); // NOI18N
        jButtonConfirm.setName("jButtonConfirm"); // NOI18N
        jButtonConfirm.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButtonConfirmMouseClicked(evt);
            }
        });
        jPanel1.add(jButtonConfirm, new org.netbeans.lib.awtextra.AbsoluteConstraints(460, 200, 140, 30));

        jRadioButton2.setBackground(resourceMap.getColor("jRadioButton2.background")); // NOI18N
        buttonGroup2.add(jRadioButton2);
        jRadioButton2.setSelected(true);
        jRadioButton2.setText(resourceMap.getString("jRadioButton2.text")); // NOI18N
        jRadioButton2.setName("jRadioButton2"); // NOI18N
        jPanel1.add(jRadioButton2, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 120, -1, 30));

        jRadioButton3.setBackground(resourceMap.getColor("jRadioButton3.background")); // NOI18N
        buttonGroup2.add(jRadioButton3);
        jRadioButton3.setText(resourceMap.getString("jRadioButton3.text")); // NOI18N
        jRadioButton3.setName("jRadioButton3"); // NOI18N
        jPanel1.add(jRadioButton3, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 160, -1, 30));

        jRadioButton4.setBackground(resourceMap.getColor("jRadioButton4.background")); // NOI18N
        buttonGroup2.add(jRadioButton4);
        jRadioButton4.setText(resourceMap.getString("jRadioButton4.text")); // NOI18N
        jRadioButton4.setName("jRadioButton4"); // NOI18N
        jPanel1.add(jRadioButton4, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 200, -1, 30));

        jLabel12.setIcon(resourceMap.getIcon("jLabel12.icon")); // NOI18N
        jLabel12.setText(resourceMap.getString("jLabel12.text")); // NOI18N
        jLabel12.setName("jLabel12"); // NOI18N
        jPanel1.add(jLabel12, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 120, -1, 30));

        jLabel13.setIcon(resourceMap.getIcon("jLabel13.icon")); // NOI18N
        jLabel13.setText(resourceMap.getString("jLabel13.text")); // NOI18N
        jLabel13.setName("jLabel13"); // NOI18N
        jPanel1.add(jLabel13, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 160, -1, 30));

        jLabel14.setIcon(resourceMap.getIcon("jLabel14.icon")); // NOI18N
        jLabel14.setText(resourceMap.getString("jLabel14.text")); // NOI18N
        jLabel14.setName("jLabel14"); // NOI18N
        jPanel1.add(jLabel14, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 200, -1, 30));

        jRadioButton9.setBackground(resourceMap.getColor("jRadioButton9.background")); // NOI18N
        buttonGroup2.add(jRadioButton9);
        jRadioButton9.setName("jRadioButton9"); // NOI18N
        jPanel1.add(jRadioButton9, new org.netbeans.lib.awtextra.AbsoluteConstraints(260, 160, -1, 30));

        jLabel4.setIcon(resourceMap.getIcon("jLabel4.icon")); // NOI18N
        jLabel4.setName("jLabel4"); // NOI18N
        jPanel1.add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(290, 160, -1, 30));

        jRadioButton10.setBackground(resourceMap.getColor("jRadioButton10.background")); // NOI18N
        buttonGroup2.add(jRadioButton10);
        jRadioButton10.setName("jRadioButton10"); // NOI18N
        jPanel1.add(jRadioButton10, new org.netbeans.lib.awtextra.AbsoluteConstraints(260, 200, -1, 30));

        jLabel6.setIcon(resourceMap.getIcon("jLabel6.icon")); // NOI18N
        jLabel6.setName("jLabel6"); // NOI18N
        jPanel1.add(jLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(290, 200, -1, 30));

        jRadioButtonK.setBackground(resourceMap.getColor("jRadioButtonK.background")); // NOI18N
        buttonGroup2.add(jRadioButtonK);
        jRadioButtonK.setText(resourceMap.getString("jRadioButtonK.text")); // NOI18N
        jRadioButtonK.setName("jRadioButtonK"); // NOI18N
        jPanel1.add(jRadioButtonK, new org.netbeans.lib.awtextra.AbsoluteConstraints(370, 200, -1, 30));

        jRadioButtonA.setBackground(resourceMap.getColor("jRadioButtonA.background")); // NOI18N
        buttonGroup2.add(jRadioButtonA);
        jRadioButtonA.setText(resourceMap.getString("jRadioButtonA.text")); // NOI18N
        jRadioButtonA.setName("jRadioButtonA"); // NOI18N
        jPanel1.add(jRadioButtonA, new org.netbeans.lib.awtextra.AbsoluteConstraints(480, 120, -1, 30));

        jRadioButtonJ.setBackground(resourceMap.getColor("jRadioButtonJ.background")); // NOI18N
        buttonGroup2.add(jRadioButtonJ);
        jRadioButtonJ.setText(resourceMap.getString("jRadioButtonJ.text")); // NOI18N
        jRadioButtonJ.setName("jRadioButtonJ"); // NOI18N
        jPanel1.add(jRadioButtonJ, new org.netbeans.lib.awtextra.AbsoluteConstraints(370, 120, -1, 30));

        jRadioButtonQ.setBackground(resourceMap.getColor("jRadioButtonQ.background")); // NOI18N
        buttonGroup2.add(jRadioButtonQ);
        jRadioButtonQ.setName("jRadioButtonQ"); // NOI18N
        jPanel1.add(jRadioButtonQ, new org.netbeans.lib.awtextra.AbsoluteConstraints(370, 160, -1, 30));

        jLabel7.setIcon(resourceMap.getIcon("jLabel7.icon")); // NOI18N
        jLabel7.setName("jLabel7"); // NOI18N
        jPanel1.add(jLabel7, new org.netbeans.lib.awtextra.AbsoluteConstraints(400, 160, -1, 30));

        jLabel15.setIcon(resourceMap.getIcon("jLabel15.icon")); // NOI18N
        jLabel15.setText(resourceMap.getString("jLabel15.text")); // NOI18N
        jLabel15.setName("jLabel15"); // NOI18N
        jPanel1.add(jLabel15, new org.netbeans.lib.awtextra.AbsoluteConstraints(400, 120, -1, 30));

        jLabel16.setIcon(resourceMap.getIcon("jLabel16.icon")); // NOI18N
        jLabel16.setText(resourceMap.getString("jLabel16.text")); // NOI18N
        jLabel16.setName("jLabel16"); // NOI18N
        jPanel1.add(jLabel16, new org.netbeans.lib.awtextra.AbsoluteConstraints(400, 200, -1, 30));

        jLabel17.setIcon(resourceMap.getIcon("jLabel17.icon")); // NOI18N
        jLabel17.setText(resourceMap.getString("jLabel17.text")); // NOI18N
        jLabel17.setName("jLabel17"); // NOI18N
        jPanel1.add(jLabel17, new org.netbeans.lib.awtextra.AbsoluteConstraints(510, 120, -1, 30));

        jLabel11.setIcon(resourceMap.getIcon("jLabel11.icon")); // NOI18N
        jLabel11.setText(resourceMap.getString("jLabel11.text")); // NOI18N
        jLabel11.setName("jLabel11"); // NOI18N
        jPanel1.add(jLabel11, new org.netbeans.lib.awtextra.AbsoluteConstraints(480, 60, -1, -1));

        jRadioButtonClub.setBackground(resourceMap.getColor("jRadioButtonClub.background")); // NOI18N
        buttonGroup1.add(jRadioButtonClub);
        jRadioButtonClub.setName("jRadioButtonClub"); // NOI18N
        jPanel1.add(jRadioButtonClub, new org.netbeans.lib.awtextra.AbsoluteConstraints(450, 60, -1, 40));

        jRadioButtonHeart.setBackground(resourceMap.getColor("jRadioButtonHeart.background")); // NOI18N
        buttonGroup1.add(jRadioButtonHeart);
        jRadioButtonHeart.setSelected(true);
        jRadioButtonHeart.setName("jRadioButtonHeart"); // NOI18N
        jPanel1.add(jRadioButtonHeart, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 60, -1, 40));

        jLabel8.setIcon(resourceMap.getIcon("jLabel8.icon")); // NOI18N
        jLabel8.setText(resourceMap.getString("jLabel8.text")); // NOI18N
        jLabel8.setName("jLabel8"); // NOI18N
        jPanel1.add(jLabel8, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 60, -1, -1));

        jRadioButtonDiamond.setBackground(resourceMap.getColor("jRadioButtonDiamond.background")); // NOI18N
        buttonGroup1.add(jRadioButtonDiamond);
        jRadioButtonDiamond.setName("jRadioButtonDiamond"); // NOI18N
        jPanel1.add(jRadioButtonDiamond, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 60, -1, 40));

        jLabel9.setIcon(resourceMap.getIcon("jLabel9.icon")); // NOI18N
        jLabel9.setText(resourceMap.getString("jLabel9.text")); // NOI18N
        jLabel9.setName("jLabel9"); // NOI18N
        jPanel1.add(jLabel9, new org.netbeans.lib.awtextra.AbsoluteConstraints(210, 60, -1, -1));

        jLabel10.setIcon(resourceMap.getIcon("jLabel10.icon")); // NOI18N
        jLabel10.setText(resourceMap.getString("jLabel10.text")); // NOI18N
        jLabel10.setName("jLabel10"); // NOI18N
        jPanel1.add(jLabel10, new org.netbeans.lib.awtextra.AbsoluteConstraints(350, 60, -1, -1));

        jRadioButtonSpade.setBackground(resourceMap.getColor("jRadioButtonSpade.background")); // NOI18N
        buttonGroup1.add(jRadioButtonSpade);
        jRadioButtonSpade.setName("jRadioButtonSpade"); // NOI18N
        jPanel1.add(jRadioButtonSpade, new org.netbeans.lib.awtextra.AbsoluteConstraints(320, 60, -1, 40));

        jLabel18.setFont(resourceMap.getFont("jLabel18.font")); // NOI18N
        jLabel18.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel18.setText(resourceMap.getString("jLabel18.text")); // NOI18N
        jLabel18.setName("jLabel18"); // NOI18N
        jPanel1.add(jLabel18, new org.netbeans.lib.awtextra.AbsoluteConstraints(6, 20, 610, -1));

        getContentPane().add(jPanel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 620, 260));

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButtonConfirmMouseClicked(java.awt.event.MouseEvent evt)//GEN-FIRST:event_jButtonConfirmMouseClicked
    {//GEN-HEADEREND:event_jButtonConfirmMouseClicked
        // TODO add your handling code here:
        if ( jRadioButton2.isSelected() )
        {
            type = Card.TWO;
        }
        if ( jRadioButton3.isSelected() )
        {
            type = Card.THREE;
        }
        if ( jRadioButton4.isSelected() )
        {
            type = Card.FOUR;
        }
        if ( jRadioButton5.isSelected() )
        {
            type = Card.FIVE;
        }
        if ( jRadioButton6.isSelected() )
        {
            type = Card.SIX;
        }
        if ( jRadioButton7.isSelected() )
        {
            type = Card.SEVEN;
        }
        if ( jRadioButton8.isSelected() )
        {
            type = Card.EIGHT;
        }
        if ( jRadioButton9.isSelected() )
        {
            type = Card.NINE;
        }
        if ( jRadioButton10.isSelected() )
        {
            type = Card.TEN;
        }
        if ( jRadioButtonJ.isSelected() )
        {
            type = Card.JACK;
        }
        if ( jRadioButtonQ.isSelected() )
        {
            type = Card.QUEEN;
        }
        if ( jRadioButtonK.isSelected() )
        {
            type = Card.KING;
        }
        if ( jRadioButtonA.isSelected() )
        {
            type = Card.ACE;
        }
        
        if ( jRadioButtonHeart.isSelected() )
        {
            suit = Card.HEART;
        }
        if ( jRadioButtonDiamond.isSelected() )
        {
            suit = Card.DIAMOND;
        }
        if ( jRadioButtonClub.isSelected() )
        {
            suit = Card.CLUB;
        }
        if ( jRadioButtonSpade.isSelected() )
        {
            suit = Card.SPADE;
        }
        
        makaoView.getCardsPanel().chooseCardAsJocker(suit, type);
        this.setVisible(false);
    }//GEN-LAST:event_jButtonConfirmMouseClicked

    /**
     * @param args the command line arguments
     */
    public static void main(String args[])
    {
        
        java.awt.EventQueue.invokeLater(new Runnable()
        {

            public void run()
            {
                //new JockerReplaceForm().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.ButtonGroup buttonGroup2;
    private javax.swing.JButton jButtonConfirm;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JRadioButton jRadioButton10;
    private javax.swing.JRadioButton jRadioButton2;
    private javax.swing.JRadioButton jRadioButton3;
    private javax.swing.JRadioButton jRadioButton4;
    private javax.swing.JRadioButton jRadioButton5;
    private javax.swing.JRadioButton jRadioButton6;
    private javax.swing.JRadioButton jRadioButton7;
    private javax.swing.JRadioButton jRadioButton8;
    private javax.swing.JRadioButton jRadioButton9;
    private javax.swing.JRadioButton jRadioButtonA;
    private javax.swing.JRadioButton jRadioButtonClub;
    private javax.swing.JRadioButton jRadioButtonDiamond;
    private javax.swing.JRadioButton jRadioButtonHeart;
    private javax.swing.JRadioButton jRadioButtonJ;
    private javax.swing.JRadioButton jRadioButtonK;
    private javax.swing.JRadioButton jRadioButtonQ;
    private javax.swing.JRadioButton jRadioButtonSpade;
    // End of variables declaration//GEN-END:variables
}
